package ConveyorBelt.Level;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Properties;

public class LevelLoader {
    private Properties prop;
    private Hashtable<String, String> table;
    
    /**
     * Load thông tin về đường dẫn của các level 
     * @param filePath Đường dẫn đến file level.properties
     * @throws FileNotFoundException
     * @throws IOException
     */
    public LevelLoader(String filePath) throws FileNotFoundException, IOException {
		prop = new Properties();										
		prop.load(new FileInputStream(filePath));
		table = new Hashtable<String, String>();
		for (Object item : prop.keySet()) {
			String level = item.toString();
			String levelPath = prop.getProperty(level);
		    table.put(level, levelPath);
		}
    }
    
    public Hashtable<String, String> getLevelChain() {
    	return table;
    }

}
